#include "Hud.h"

Hud::Hud(unsigned int x_min, unsigned int x_max, unsigned int y_min, unsigned int y_max) 
		: matrixTransform(new osg::MatrixTransform()), 
		projectionMatrix(new osg::Projection())
{
	matrixTransform->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
	matrixTransform->addChild(projectionMatrix);

	projectionMatrix->setMatrix(osg::Matrix::ortho2D(x_min,x_max,y_min,y_max));
}

Hud::~Hud() {}

osg::Group& Hud::getRoot() {
  return *matrixTransform;
}

void Hud::addTextBox(TextBox& t) {
  projectionMatrix->addChild(t.getGeode());
}


void Hud::removeTextBox(TextBox& t) {
  projectionMatrix->removeChild(t.getGeode());
}